Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 14, 2024 11:20
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nchevobbe
nchevobbe / screenshot.js
Last active May 14, 2024 11:17
Log a data URL containing a screenshot of the window
let canvas = window.document.createElementNS("http://www.w3.org/1999/xhtml", "html:canvas");
let context = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
context.drawWindow(window, 0, 0, canvas.width, canvas.height, "white");
console.log(`
📸 📸 📸 📸
${canvas.toDataURL()}
@rsms
rsms / macos-distribution.md
Last active May 14, 2024 11:15
macOS distribution — code signing, notarization, quarantine, distribution vehicles
@wojteklu
wojteklu / clean_code.md
Last active May 14, 2024 11:15
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 14, 2024 11:15
Files for PlayStation BIOS Files NA-EU-JP
@srikiranvelpuri
srikiranvelpuri / refreshOAuthToken.js
Last active May 14, 2024 11:13
Postman PreRequestScript to check if an OAuth token has expired and, if so, refreshes it by making a new authentication request.
const expiryDate = new Date(pm.environment.get('tokenExpiryDate'));
const currDate = new Date(Date.now());
const isTokenExpired = (isNaN(expiryDate) || expiryDate) < currDate;
if(isTokenExpired){
pm.sendRequest({
url: pm.globals.get("oAuthUrl"),
method: 'POST',
header: {
'Authorization': pm.globals.get("basicAuth"),
@v1mkss
v1mkss / JetBrains Activation.md
Last active May 14, 2024 11:13
JetBrains Activation

JetBrains Activation

  • No proxy for:
*.apache.org, *.github.com, *.github.io, *.githubusercontent.com, *.gitlab.com, *.google.com, *.gradle.org, *.jetbrains.space, *.maven.org, cache-redirector.jetbrains.com, cloudconfig.jetbrains.com, download-cdn.jetbrains.com, download.jetbrains.com, downloads.marketplace.jetbrains.com, ea-report.jetbrains.com, github.com, gitlab.com, google.com, gradle.org, jcenter.bintray.com, plugins.jetbrains.com, resources.jetbrains.com, www.jetbrains.com

Activation Key:

UX394X3HLT-eyJsaWNlbnNlSWQiOiJVWDM5NFgzSExUIiwibGljZW5zZWVOYW1lIjoiSG9uZ2lrIFVuaXZlcnNpdHntmY3snbXrjIDtlZnqtZAiLCJsaWNlbnNlZVR5cGUiOiJDTEFTU1JPT00iLCJhc3NpZ25lZU5hbWUiOiLkvJfliJvkupEg5bel5L2c5a6kIiwiYXNzaWduZWVFbWFpbCI6ImhhbmF6YXdhbWl0b0BnbWFpbC5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDI0LTEyLTEzIiwiZXh0ZW5kZ
@dukejones
dukejones / mydomain.com.conf
Created October 1, 2023 05:12
SvelteKit Nginx config -- nodejs adapter
upstream sveltekit-server {
server 127.0.0.1:3000;
keepalive 8;
}
server {
listen 80;
server_name mydomain.com;
root /home/deploy/frontend/build/client;
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active May 14, 2024 11:10 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"